#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

const int N=1e5+5;
const int MOD = 1e9+7;
const int MAXN = 1e5+5;
ll fac[MAXN], inv_fac[MAXN];
vector<int> n1(N,0),n2(N,0);

ll quick_pow(ll a, ll b) {
    ll res = 1;
    while (b) {
        if (b & 1) res =  res * a % MOD; // 可能溢出时用快速乘
        a = a * a % MOD;
        b >>= 1;
    }
    return res;
}

ll inv(ll a,ll b){
    return quick_pow(a,b-2);
}

void init_comb() {
    fac[0] = 1;
    for (int i = 1; i < MAXN; ++i)
        fac[i] = fac[i-1] * i % MOD;
    inv_fac[MAXN-1] = inv(fac[MAXN-1], MOD);
    for (int i = MAXN-2; i >= 0; --i)
        inv_fac[i] = inv_fac[i+1] * (i+1) % MOD;
}

ll comb(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fac[n] * inv_fac[k] % MOD * inv_fac[n-k] % MOD;
}

int dfs(string& s,int i,int c){
    int cnt=0;
    while(true){
        cnt++;
        if(s[i]=='('){
            n1[c]++;
            int p=dfs(s,i+1,c+1);
            i+=p;
        }else{
            n2[c]++;
            return cnt;
        }
    }
    
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    init_comb();
    string s;
    cin>>s;
    dfs(s,0,0);
    for(int i=0;i<5;i++){
        cout<<n1[i]<<' ';
    }
    cout<<'\n';
    for(int i=0;i<5;i++){
        cout<<n2[i]<<' ';
    }
    cout<<'\n';
    int p=0;
    ll res=1;
    while(!(n1[p]==0&&n2[p]==1)){
        res*=comb(n1[p]+n2[p],n1[p]);
        p++;
    }
    cout<<res;
    return 0;
}
